<?php if ($mode == "CAT") { ?>
    <div class="widget">
        <div class="widgetTitle">


            <?php if (!empty($category)) { ?>
                <h3>All listings : <?= $category->name; ?> </h3>
            <?php } else { ?>
                <h3>All listings : </h3>
            <?php } ?>
        </div>
        <!-- /.widgetTitle -->


        <div class="block">
            <?php if (!empty($category)) { ?>
                <?= $category->description; ?>
            <?php } else { ?>
                Searching for businesses with <?= $location->name; ?>, <?= $location->prefix; ?>
            <?php } ?>
        </div>
        <div class="block">
            <?php if (Settings::get('en', 'publisher_id')) { ?>
                <div class="adspace end">
                    <script async
                            src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- RESPONSIVE2 -->
                    <ins class="adsbygoogle" style="display: block"
                         data-ad-client="<?php echo trim(Settings::get('en', 'publisher_id')); ?>"
                         data-ad-format="auto"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>
            <?php } ?>
        </div>
        <?php if ($listings) { ?>
            <?php foreach ($listings as $list): ?>
                <div class="widgetContent bottom-border listing">
                    <div class="row nomargin">
                        <div class="col-md-9 col-sm-9 col-xs-9">

                            <h2>
                                <i class="fa fa-chevron-circle-right text-dark-orange"></i>
                                <a href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"> <?= $list->title; ?></a>
                            </h2>

                            <blockquote>
                                <p><?= (!empty($list->address1) ? $list->address1 : null); ?></p>

                                <p>
                                    <?php foreach (Terms::location($list->id) as $loc): ?>
                                        <a href="<?= URL::base(); ?>/<?= Locations::findPK($loc->value)->slug; ?>"><?= Locations::findPK($loc->value)->name; ?>
                                            , </a>
                                    <?php endforeach; ?>
                                </p>
                            </blockquote>


                            <p class="thin">
                                <?php foreach (Terms::category($list->id) as $cat): ?>
                                    <a href="<?= Url::base();?>/<?= Str::slug(Location::get());?>/<?= Categories::findPK($cat->value)->slug;?>"><?= Categories::findPK($cat->value)->name; ?>,</a>
                                <?php endforeach; ?>
                            </p>

                            <p class="margin-top">
                                <div class="btn-group">
                                    <a class="btn btn-link" title="Map" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-map-marker fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Photo" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-image fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Video" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-video-camera fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Reviews" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-comment fa-lg fa-light"></i></a>
                                    <a class="btn btn-link text-danger" title="Reviews" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-flag fa-lg fa-light"></i></a>
                                </div>
                            </p>
                        </div>

                        <div class="col-md-3 col-sm-3 col-xs-3 leftBorder">
                            <a href="<?= URl::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><img
                                    class="img-responsive"
                                    src="<?= URL::base(); ?>/storage/uploads/logos/<?= $list->logo; ?>"
                                    alt="<?= $list->title; ?>" title="<?= $list->title; ?>"></a>
                        </div>


                    </div>

                </div><!-- /.widgetContent -->
            <?php endforeach;
        } else { ?>
            <div class="block"><i class="fa fa-exclamation fa-lg"></i> Oops! No data found...</div>
        <?php } ?>

        <div class="block">
            <?php if (Settings::get('en', 'publisher_id')) { ?>
                <div class="adspace end">
                    <script async
                            src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- RESPONSIVE2 -->
                    <ins class="adsbygoogle" style="display: block"
                         data-ad-client="<?php echo trim(Settings::get('en', 'publisher_id')); ?>"
                         data-ad-format="auto"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>
            <?php } ?>
        </div>
    </div><!-- /.widget -->
    <input type="submit" class="submitbtn rightalign" value="next">

<?php } ?>
<?php if ($mode == "LOC") { ?>
     <div class="widget">
        <div class="widgetTitle">


            <?php if (!empty($category)) { ?>
                <h3>All listings : <?= $category->name; ?> </h3>
            <?php } else { ?>
                <h3>All listings : </h3>
            <?php } ?>
        </div>
        <!-- /.widgetTitle -->


        <div class="block">
            <?php if (!empty($category)) { ?>
                <?= $category->description; ?>
            <?php } else { ?>
                Searching for businesses with <?= $location->name; ?>, <?= $location->prefix; ?>
            <?php } ?>
        </div>
        <div class="block">
            <?php if (Settings::get('en', 'publisher_id')) { ?>
                <div class="adspace end">
                    <script async
                            src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- RESPONSIVE2 -->
                    <ins class="adsbygoogle" style="display: block"
                         data-ad-client="<?php echo trim(Settings::get('en', 'publisher_id')); ?>"
                         data-ad-format="auto"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>
            <?php } ?>
        </div>
        <?php if ($listings) { ?>
            <?php foreach ($listings as $list): ?>
                <div class="widgetContent bottom-border listing">
                    <div class="row nomargin">
                        <div class="col-md-9 col-sm-9 col-xs-9">

                            <h2>
                                <i class="fa fa-chevron-circle-right text-dark-orange"></i>
                                <a href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"> <?= $list->title; ?></a>
                            </h2>

                            <blockquote>
                                <p><?= (!empty($list->address1) ? $list->address1 : null); ?></p>

                                <p>
                                    <?php foreach (Terms::location($list->id) as $loc): ?>
                                        <a href="<?= URL::base(); ?>/<?= Locations::findPK($loc->value)->slug; ?>"><?= Locations::findPK($loc->value)->name; ?>
                                            , </a>
                                    <?php endforeach; ?>
                                </p>
                            </blockquote>


                            <p class="thin">
                                <?php foreach (Terms::category($list->id) as $cat): ?>
                                    <a href="<?= Url::base();?>/<?= Str::slug(Location::get());?>/<?= Categories::findPK($cat->value)->slug;?>"><?= Categories::findPK($cat->value)->name; ?>,</a>
                                <?php endforeach; ?>
                            </p>

                            <p class="margin-top">
                                <div class="btn-group">
                                    <a class="btn btn-link" title="Map" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-map-marker fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Photo" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-image fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Video" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-video-camera fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Reviews" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-comment fa-lg fa-light"></i></a>
                                    <a class="btn btn-link text-danger" title="Reviews" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-flag fa-lg fa-light"></i></a>
                                </div>
                            </p>
                        </div>

                        <div class="col-md-3 col-sm-3 col-xs-3 leftBorder">
                            <a href="<?= URl::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><img
                                    class="img-responsive"
                                    src="<?= URL::base(); ?>/storage/uploads/logos/<?= $list->logo; ?>"
                                    alt="<?= $list->title; ?>" title="<?= $list->title; ?>"></a>
                        </div>


                    </div>

                </div><!-- /.widgetContent -->
            <?php endforeach;
        } else { ?>
            <div class="block"><i class="fa fa-exclamation fa-lg"></i> Oops! No data found...</div>
        <?php } ?>

        <div class="block">
            <?php if (Settings::get('en', 'publisher_id')) { ?>
                <div class="adspace end">
                    <script async
                            src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- RESPONSIVE2 -->
                    <ins class="adsbygoogle" style="display: block"
                         data-ad-client="<?php echo trim(Settings::get('en', 'publisher_id')); ?>"
                         data-ad-format="auto"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>
            <?php } ?>
        </div>
    </div><!-- /.widget -->
    <input type="submit" class="submitbtn rightalign" value="next">

<?php } ?>
<?php if ($mode == "LISTING") { ?>

    <div class="widget">
        <div class="widgetTitle">
            <h3>All Listings </h3>

        </div>
        <!-- /.widgetTitle -->

        <div class="block">
            Searching for businesses with <?= $title; ?>
            in <?= $location; ?><?php if ($loc) { ?>, <?= $loc; ?><?php } ?>
        </div>

        <div class="block">
            <?php if (Settings::get('en', 'publisher_id')) { ?>
                <div class="adspace end">
                    <script async
                            src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- RESPONSIVE2 -->
                    <ins class="adsbygoogle" style="display: block"
                         data-ad-client="<?php echo Settings::get('en', 'publisher_id'); ?>"
                         data-ad-format="auto"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>


            <?php } ?>
        </div>
        <?php if ($listings) { ?>
            <?php foreach ($listings as $list): ?>
                <div class="widgetContent bottom-border listing">
                    <div class="row nomargin">
                        <div class="col-md-9 col-sm-9 col-xs-9">

                            <h2>
                                <i class="fa fa-chevron-circle-right text-dark-orange"></i>
                                <a href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"> <?= $list->title; ?></a>
                            </h2>

                            <blockquote>
                                <p><?= (!empty($list->address1) ? $list->address1 : null); ?></p>

                                <p>
                                    <?php foreach (Terms::location($list->id) as $loc): ?>
                                        <a href="<?= URL::base(); ?>/<?= Locations::findPK($loc->value)->slug; ?>"><?= Locations::findPK($loc->value)->name; ?>
                                            , </a>
                                    <?php endforeach; ?>
                                </p>
                            </blockquote>


                            <p class="thin">
                                <?php foreach (Terms::category($list->id) as $cat): ?>
                                    <a href="<?= Url::base();?>/<?= Str::slug(Location::get());?>/<?= Categories::findPK($cat->value)->slug;?>"><?= Categories::findPK($cat->value)->name; ?>,</a>
                                <?php endforeach; ?>
                            </p>

                            <p class="margin-top">
                                <div class="btn-group">
                                    <a class="btn btn-link" title="Map" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-map-marker fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Photo" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-image fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Video" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-video-camera fa-lg fa-light"></i></a>
                                    <a class="btn btn-link" title="Reviews" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-comment fa-lg fa-light"></i></a>
                                    <a class="btn btn-link text-danger" title="Reviews" href="<?= URL::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><i class="fa fa-flag fa-lg fa-light"></i></a>
                                </div>
                            </p>
                        </div>

                        <div class="col-md-3 col-sm-3 col-xs-3 leftBorder">
                            <a href="<?= URl::base(); ?>/<?= Commoncall::postLink($list->id); ?>"><img
                                    class="img-responsive"
                                    src="<?= URL::base(); ?>/storage/uploads/logos/<?= $list->logo; ?>"
                                    alt="<?= $list->title; ?>" title="<?= $list->title; ?>"></a>
                        </div>


                    </div>

                </div><!-- /.widgetContent -->
            <?php endforeach;
        } else { ?>
            <div class="block"><i class="fa fa-exclamation fa-lg"></i> Oops! No data found...</div>
        <?php } ?>

         <div class="block">
            <?php if (Settings::get('en', 'publisher_id')) { ?>
                <div class="adspace end">
                    <script async
                            src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- RESPONSIVE2 -->
                    <ins class="adsbygoogle" style="display: block"
                         data-ad-client="<?php echo trim(Settings::get('en', 'publisher_id')); ?>"
                         data-ad-format="auto"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>
            <?php } ?>
        </div>
            
    </div><!-- /.widget -->
    <input type="submit" class="submitbtn rightalign" value="next">

<?php } ?>



